<template>
  <div class="h-100">
    <biz-list ref="budinessList" page-name="backup" @operate="operate" />
    <!-- 编辑/查看通道信息 -->
    <edit
      :visible="showSegment"
      :operate-type="operateType"
      :row-data="rowData"
      @close="close"
    />
  </div>
</template>

<script>
  import Edit from './Edit.vue'
  import BizList from '../manager/components/BizList'

  export default {
    name: 'BussinessBackup',
    components: { BizList, Edit },
    provide() {
      return {
        functionName: 'backup'
      }
    },
    data() {
      return {
        showSegment: false,
        operateType: 'mod',
        rowData: {}
      }
    },
    methods: {
      operate(data) {
        switch (data.type) {
        case 'mod':
          // 修改通道
          this.rowData = data.data
          this.operateType = 'mod'
          this.showSegment = true
          break
        case 'view':
          //   查看通道
          this.rowData = data.data
          this.operateType = 'view'
          this.showSegment = true
          break
        default:
          break
        }
      },
      close(load) {
        this.showSegment = false
        if (load === true) {
          this.$refs.budinessList && this.$refs.budinessList.loadData()
        }
      }
    }
  }
</script>

<style></style>
